<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>博客</title>
	<link rel="stylesheet" href="./css/reset.css">
	<link rel="stylesheet" href="./css/index.css">
</head>
<body>
	<header>
		<h2>潇洒霸王的blog</h2>
		<p>乘风行,无惧!</p>
	</header>
	<nav>
		<ul>
			<li><a href="./index.php">文章</a></li>
			<li>
			<a href="./index.php">最热门<img src="./image/news.png" alt=""></a>

			</li>
			<li><a href="#">关于我们</a></li>
			<li><a href="./index.php">技术</a></li>
			<li><a href="./index.php">留言</a></li>
		</ul>
	</nav>
	<div id="main">
	<div id="rside">
	<aside>
		<form action=""><input type="text" placeholder="Search..."></form>
	</aside>
		<aside>
			<h4>栏目列表</h4>
			        <ul>
			            <?php foreach($cat as $v){ ?>
						<li><a href="./index.php?cat_id=<?php echo $v['cat_id']; ?>"><?php echo $v['catname']; ?></a>&nbsp;(<?php echo $v['num'];?>)</li>
						<?php } ?>
					</ul>

		</aside>

		<aside>
			<h4>标签列表</h4>
			        <ul>
						<!-- <?php foreach($tag as $v){ ?>
						<li><a href="./index.php?tags=<?php echo $v['tags']; ?>"><?php echo $v['tags']; ?>
						(<?php if(isset($_GET['tags'])){echo $num;} else {echo '';} ?>)</a></li> <?php } ?> -->

					<li><a href="./index.php?tags=游戏">游戏</a>&nbsp;(*)</li>
					<li><a href="./index.php?tags=人生">人生</a>&nbsp;(*)</li>
					<li><a href="./index.php?tags=美女">美女</a>&nbsp;(*)</li>
					<li><a href="./index.php?tags=技术">技术</a>&nbsp;(*)</li>
					<li><a href="./index.php?tags=哲学">哲学</a>&nbsp;(*)</li>

					</ul>
		</aside>

		<aside>
			<h4>近期文章</h4>
			        <ul>
                       <?php foreach($arts as $v){ ?>
						<li><a href="./art.php?art_id=<?php echo $v['art_id']; ?>"><?php echo $v['title']; ?></a>&nbsp;</li>
						<?php } ?>

					</ul>
		</aside>

		<aside>
			<h4>分类目录</h4>
			        <ul>
						<li><a href="">我是标题1</a>&nbsp;(1)</li>
						<li><a href="">我是标题2</a>&nbsp;(2)</li>
						<li><a href="">我是标题3</a>&nbsp;(3)</li>
						<li><a href="">我是标题4</a>&nbsp;(4)</li>
					</ul>
		</aside>
	</div>
	<div id="lside">
	<?php if(isset($_GET['tags'])){ ?>
		<?php foreach($tag as $v){ ?>
		<article>
			<h2><a href="./art.php?art_id=<?php echo $v['art_id']; ?>"><?php echo $v['title']; ?></a></h2>
			<div class="arthead">
			<time><?php echo date('Y/m/d',$v['pubtime']); ?></time>
			<span>by 十八</span>
			<span id="t2"><a href="#"><?php echo $v['catname']; ?></a></span>
			<span id="t1"><a href="#"><?php echo $v['comm']; ?>条评论</a></span>
			</div>
			<p>
			 <?php echo $v['content']; ?>
			</p>
		</article>
		<?php } } else { ?>
	<?php foreach($art as $v){ ?>
		<article>
			<h2><a href="./art.php?art_id=<?php echo $v['art_id']; ?>"><?php echo $v['title']; ?></a></h2>
			<div class="arthead">
			<time><?php echo date('Y/m/d',$v['pubtime']); ?></time>
			<span>by 十八</span>
			<span id="t2"><a href="#"><?php echo $v['catname']; ?></a></span>
			<span id="t1"><a href="#"><?php echo $v['comm']; ?>条评论</a></span>
			</div>
			<a href="./art.php?art_id=<?php echo $v['art_id']; ?>"><img src="<?php echo '.'.$v['pic']; ?>" alt=""></a>
			<p>
			 <?php echo mb_substr($v['content'],0,100)."\n"."\n".'[......]','<br>'; ?>
			 <a href="./art.php?art_id=<?php echo $v['art_id']; ?>"><?php echo '阅读全文'; ?></a>
			</p>
		</article>
		<?php }}?>

		<div id="pager">
			pages:&nbsp;
			<?php foreach($page as $k=>$v){ ?>
			<?php if($k == $curr) { ?>
            <?php echo $k; } else { ?>
			<a href="index.php?<?php echo $v; ?>">
			<?php echo $k; ?>
			</a>
			<?php } ?>
			<?php } ?>

		</div>
	</div>
	</div>
	<div class="clear"></div>
	<footer>
		<div class="inside-site-info grid-container grid-parent">
				<span class="copyright">Copyright &copy; 2016</span> 	&#x000B7; <a href="http://generatepress.com" target="_blank" title="GeneratePress">GeneratePress</a> &#x000B7; <a href="http://wordpress.org" target="_blank" title="Proudly powered by WordPress">WordPress</a>
	    </div>

	</footer>

</body>
</html>